#include <iostream>
#include <string>
#include "chapter13_practice3_dma.h"

void Practice_13_3();
const int CLIENTS = 3;
//int main()
//{
//	Practice_13_3();
//	return 0;
//}

void Practice_13_3()
{
	using namespace std;
	DmaABC_practice * p_clients[CLIENTS];
	string temp;
	int tempnum;
	
	cout << "Enter the label: ";
	getline(cin, temp);
	const char * s = temp.c_str();
	cout << "Enter the rating: ";
	cin >> tempnum;

	for (int i = 0; i < CLIENTS; i++)
	{
		char kind='0';
		cout << "Enter the kind: " << endl;
		cout << "1 for baseABC,2 for lacksABC,3 for hasABC: ";
		while (cin>>kind&&(kind!='1'&&kind!='2'&&kind!='3'))
		{
			cout << "Enter either 1 ,2 or 3: ";
		}
		if (kind == '1')
		{
			p_clients[i] = new baseDMA_practice(s, tempnum);
		}
		if (kind == '2')
		{
			cin.get();
			cout << "Enter the color: ";
			string ts;
			getline(cin, ts);

			const char * sw = ts.c_str();
			p_clients[i] = new lacksDMA_practice(sw, s, tempnum);
		}
		if (kind == '3')
		{
			cin.get();
			cout << "Enter the style: ";
			string ts;
			getline(cin, ts);



			const char * sw = ts.c_str();
			p_clients[i] = new hasDMA_practice(sw, s, tempnum);
		}
	/*	while (cin.get() != '\n')
			continue;*/
	}

	for (int i = 0; i < 3; i++)
	{
		p_clients[i]->View();
	}
	cout << "=============================" << endl;
	for (int i = 0; i < 3; i++)
	{
		cout <<* p_clients[i] << endl;
	}
	return;
}